
<?php

function is_user_agent_ie() {
    if (isset($_SERVER['HTTP_USER_AGENT']) &&
            (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false))
        return true;
    else
        return false;
}
?>
<script src="<?php echo javascript_path('jquery.autocomplete.js') ?>"></script> 
<div class="login_wrapper">
    <div class="dark_header">
        <div class="login_page_login_table_wrapper">
            <form action="<?php echo url_for('@sf_guard_signin') ?>" method="post">
                <?php echo $form2['_csrf_token'] ?>
                <table class="login_page_login_table" align="right" width="40%">
                    <tr>
                        <td class="login_username">
                            Username
                        </td>
                        <td class="login_password">
                            Password
                        </td>
                        <td>

                        </td>
                    </tr>
                    <tr>
                        <td class="login_smaller_input">
                            <?php echo $form2['username'] ?>
                        </td>
                        <td class="login_smaller_input">
                            <?php echo $form2['password'] ?>
                        </td>
                        <td>
                            <input type="image" src="<?php echo image_path('login_page_login.gif') ?>"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="keepme">
                            <input type="checkbox" id="keepme"/>
                            <label class="hint" for="keepme"><?php echo __('Keep me logged in') ?></label>
                            <div class="clear"></div>
                        </td>
                        <td class="hint">
                            <a href="<?php echo url_for2("forget_password") ?>"><?php echo __('Forgot your password? or need help?') ?></a>
                        </td>
                        <td>
                        </td>
                    </tr>
                </table>
            </form>
            <div class="clear"></div>
            <?php if ($sf_user->hasFlash('error')) { ?>
                <script>
                    $('.login_smaller_input input').addClass('error');
                </script>
            <?php } ?>
        </div>
        <div class="clear"></div>
    </div>
    <div class="login_main">
        <div class="social">
            <div class="fb-like" data-href="http://doseyeh.com" data-send="false" data-layout="button_count" data-width="80" data-show-faces="false"></div>
            <!-- Place this tag where you want the +1 button to render -->
            <g:plusone size="medium" annotation="inline" width="120"></g:plusone>
            <a href="https://twitter.com/share" class="twitter-share-button"><?php echo __('Tweet') ?></a>
        </div>

        <div class="clear"></div><!--clear-->
        <div class="textBox">


            <?php /*             * **** TITLE PART ************** */ ?>
            <div class="reset_password">

                <table cellspacing="0" cellpadding="0" border="0"  class="table_req_pass_out">
                    <tbody>
                        <tr>
                            <td width="8" valign="top"><?php echo image_tag("/images/tlc.jpg") ?></td>
                            <td width="615" class="borderTop"></td>
                            <td width="8" valign="top"><?php echo image_tag("/images/trc.jpg") ?></td>
                        </tr>
                        <tr>
                            <td valign="top" class="borderLeft borderRight call_back_form_td" colspan="3">

                                <?php if (isset($message)) { ?>    
                                    <?php echo __('Password reset successfully.') ?>
                                <?php } else { ?>
                                    <?php echo isset($error) ? __($error) : '' ?>
                                    <form action="<?php echo url_for("user/resetForgotten?token=$token&timestamp=$timestamp") ?>" method="post" id="req_pass_form">
                                        <table class="table_req_pass" >
                                            <?php $form->addCSRFProtection() ?>
                                            <?php $form->renderGlobalErrors() ?>
                                            <?php foreach ($form as $key => $field) { ?>         
                                                <tr>
                                                    <th>
                                                        <?php echo ($key!='_csrf_token')? $field->renderLabel():'' ?>
                                                    </th>
                                                    <td>
                                                        <?php if ($form[$key]->hasError()) { ?>
                                                            <div class="signin-error"><?php echo $form[$key]->renderError(); ?></div>
                                                        <?php } ?>
                                                        <?php echo $field->render(); ?>
                                                    </td>
                                                </tr>
                                            <?php } ?>

                                            <tr><td colspan="2" align="right" style="text-align:right;">
                                                    <div class="myButton">
                                                        <input type="submit" value="<?php echo __('Submit') ?>" onclick="$('#req_pass_form').submit()">
                                                    </div>
                                                </td></tr>
                                        </table>

                                    </form>
                                <?php } ?>



                            </td>

                        </tr>
                        <tr>
                            <td width="8" valign="top"><?php echo image_tag("/images/blc.jpg") ?></td>
                            <td height="8" class="borderBottom"></td>
                            <td width="8" valign="top"><?php echo image_tag("/images/brc.jpg") ?></td>
                        </tr>
                    </tbody></table>
            </div>
            <div class="clear"></div><!--clear-->
        </div><!--textBox1-->
        <div class="clear"></div><!--clear-->



    </div>
</div>

<script>
    
    $('#autocomplete_sf_guard_user_university_id').change(function(){
       
         
        $.ajax({
            url: '<?php echo url_for2('auto_complete_faculty') ?>?uni_id='+$('#sf_guard_user_university_id').val()
            
        });
    });
    
    
</script>
